import request from "@/utils/request";
import { param } from "@/utils";

//结算管理列表
export const settleList = (query, data) => {
  return request({
    url: `/finance/settle/page?${param(query)}`,
    method: "post",
    data
  });
};
//导出
export const exportRecord = data => {
  return request({
    url: "/finance/settle/export",
    method: "post",
    responseType: "blob",
    data
  });
};
//撤回审批
export const cancelProcess = contractId => {
  return request({
    url: `/finance/settle/cancelProc/${contractId}`,
    method: "get"
  });
};
//结算详情
export const settlementDetails = contractId => {
  return request({
    url: `/finance/settle/detail/${contractId}`,
    method: "get"
  });
};
//是否有未完成的请款单
export const havePleaseSlip = contractId => {
  return request({
    url: `/finance/settle/havePleaseSlip/${contractId}`,
    method: "get"
  });
};
//是否有未完成的领料单
export const hasMaterialSlip = contractId => {
  return request({
    url: `/finance/settle/hasMaterialSlip/${contractId}`,
    method: "get"
  });
};
//是否有未完成的判责单
export const hasDutySlip = contractId => {
  return request({
    url: `/finance/settle/hasDutySlip/${contractId}`,
    method: "get"
  });
};
//是否有未完成的报销单
export const hasReimburseSlip = contractId => {
  return request({
    url: `/finance/settle/hasReimburseSlip/${contractId}`,
    method: "get"
  });
};

/**
 * 合作方
 */

export const getPartner = value => {
  return request({
    url: "/finance/partner/list",
    method: "post",
    data: {
      name:value,
      status:1
    }
  });
};
/**
 * 结算申请
 */
export const submitApplySettlement = data => {
  return request({
    url: "/finance/settle/apply",
    method: "post",
    data
  });
};
